<?php
    $serverpath=$_SERVER['DOCUMENT_ROOT'];
	include ($serverpath.'/Classes/book.php');
	//serializacion
	$serialize_book = file_get_contents('store_searchbook');
	$book = unserialize($serialize_book);
	//seteo de variables
	$book->set_title($_POST['title']);
	$book->set_author($_POST['author']);
	$book->set_text($_POST['textArea']);
	$book->set_section($_POST['select']);
	$book->set_price($_POST['price']);
	$book->set_amount($_POST['amount']);
	$book->set_averagePoints("0");
	$book->set_visits("0");
	$book->set_picture($_POST['uploadedfile']);
	
	//persistencia del obj
	$book->savetofile($book->get_id());
	$serialize_book = serialize($book);
	file_put_contents('store_searchbook',$serialize_book);
	header('Location: modifyItem.php');
?>